from api.login_api import LoginAPI


class LoginToken(object):
    @classmethod
    def get_au_headers(cls, body):
        # 功能：获取认证请求头
        # :param body: 登陆的请求体数据
        # :return: 成功登陆的认证请求头{"Authorization":token}
        #         1.发送登录请求
        resp = LoginAPI.login(body)
        json_data = resp.json()
        print(json_data)
        #2.获取响应结果的token值
        token = json_data.get('data')
        print('token = ',token)

        return {"Authorization":token}